<include file="Public:head"/>
<link rel="stylesheet" href="{lanrain::STATICS}/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="{lanrain::STATICS}/kindeditor/plugins/code/prettify.css" />
<script src="{lanrain::STATICS}/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="{lanrain::STATICS}/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
<script src="{lanrain::STATICS}/kindeditor/plugins/code/prettify.js" type="text/javascript"></script>
<script>
	KindEditor.ready(function(K){
		var editor = K.editor({
			allowFileManager:true
		});
		K('#upload').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					fileUrl : K('#pic').val(),
					clickFn : function(url, title) {
						if(url.indexOf("http") > -1){
							K('#pic').val(url);
						}else{
							K('#pic').val("{lanrain::C('site_url')}"+url);
						}
						editor.hideDialog();
					}
				});
			});
		});
	});
</script>
 <link rel="stylesheet" type="text/css" href="{lanrain::RES}/css/cymain.css" />
 <link rel="stylesheet" href="{lanrain::STATICS}/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="{lanrain::STATICS}/kindeditor/plugins/code/prettify.css" />
<script src="{lanrain::STATICS}/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="{lanrain::STATICS}/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
<script src="{lanrain::STATICS}/kindeditor/plugins/code/prettify.js" type="text/javascript"></script>
<script src="{lanrain::RES}/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="{lanrain::RES}/js/formCheck/formcheck.js"> </script>
<script>

var editor;
KindEditor.ready(function(K) {
editor = K.create('#text-content', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'source','undo','clearhtml','hr',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image','link', 'unlink','baidumap','lineheight','table','anchor','preview','print','template','code','cut']
});

});
</script>

  <div class="content" style="width:920px; background:none; margin-left:275px; border:none; margin-bottom:30px;" > 
   <div class="cLineB"> 
    <h4>自定义表单设置</h4> 
    <a href="{lanrain::U('Selfform/index',array('token'=>$token))}" class="right  btnGreen" style="margin-top:-27px">返回</a> 
   </div> 
   

   <form class="form" method="post" id="form" action="" enctype="multipart/form-data"> 
<if condition="$isUpdate eq 1">
<input type="hidden" name="id" value="{lanrain:$set.id}" />
</if>
<input type="hidden" name="discount" id="discount" value="{lanrain:$set.discount}" />
    <div class="msgWrap bgfc"> 
     <table class="userinfoArea" style=" margin:0;" border="0" cellspacing="0" cellpadding="0" width="100%"> 
      <tbody> 
       <tr> 
        <th><span class="red">*</span>名称：</th> 
        <td><input type="text" id="name" name="name" value="{lanrain:$set.name}" class="px require" style="width:400px;" /></td> 
       </tr> 
       </tr>
        <tr> 
        <th><span class="red">*</span>关键词：</th>
        <td><input type="text" name="keyword" id="keyword" value="{lanrain:$set.keyword}" class="px" style="width:400px;" /></td> 
       </tr>
       <tr> 
        <th><span class="red"></span>简介：</th> 
        <td><textarea name="intro" class="px" style="width:400px;height:80px;">{lanrain:$set.intro}</textarea></td> 
       </tr>
       <tr> 
        <th><span class="red">*</span>截止日期：</th> 
        <td><input type="input" class="px" id="enddate" value="{lanrain:$set.endtime|date="Y-m-d",###}" onClick="WdatePicker()" name="enddate" /></td> 
       </tr>

        <tr> 
        <th><span class="red">*</span>Logo地址：</th>
        <td><input type="text" name="logourl" value="{lanrain:$set.logourl}" id="pic" class="px" style="width:400px;"  readonly="readonly"/><span class="ke-button-common" id="upload" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="Upload"></span></td> 
       </tr>
       <tr> 
        <th><span class="red"></span>提交成功提示：</th>
        <td><input type="text" id="successtip" name="successtip" value="{lanrain:$set.successtip}" class="px" style="width:400px;" /> 默认：提交成功</td> 
       </tr>
       <tr> 
        <th><span class="red"></span>提交失败提示：</th>
        <td><input type="text" id="failtip" name="failtip" value="{lanrain:$set.failtip}" class="px" style="width:400px;" /> 默认：提交失败</td> 
       </tr>
        <TR>
                  <TH valign="top"><label for="info">图文详细页内容：</label></TH>
                  <TD><textarea name="content" id="text-content"  rows="5" style="width:590px;height:360px">{lanrain:$set.content}</textarea></TD>
                </TR>  
       <tr>         
       <th>&nbsp;</th>
       <td>
      <input type="hidden" name="groupon" value="1" />
       <button type="submit" name="button" class="btnGreen">保存</button> &nbsp; <a href="{lanrain::U('Groupon/products',array('token'=>$token))}" class="btnGray vm">取消</a></td> 
       </tr> 
      </tbody> 
     </table> 
     </div>
    
   </form> 
  </div> 
<script language="javascript">
$(function(){

	$("#form").valid([
	{ name:"name",simple:"名称",require:true},
	{ name:"keyword",simple:"关键词",require:true}
		
	],true,true);

})
</script>
  <include file="Public:footer" />